<template>
	<view class="my-main">
		<view class="my-box">
			<view>我的简介</view>
			<view style="margin:120px 0;">
				<button type="warn" @tap="logout">注销</button>
			</view>

			<button type="default" @tap="goGaviaget">naviagetTo保留当前页，跳转到应用其他页面</button>
			<view class="">
				-------
			</view>
			<button type="warn" @tap="goOpenUrl">openURL调用第三方程序打开指定的URL</button>
			<view class="">
				-------
			</view>
			<button type="primary" @tap="goRedirectTo">redirectTo关闭当前页，跳转到应用其他页面</button>
			<view class="">
				-------
			</view>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			logout() {
					uni.removeStorageSync('username');
					uni.removeStorageSync("userphone");
					uni.showToast({
						title:'注销成功！'
					})
					uni.redirectTo({
						url:'/pages/index/index'
					})
					
			},
			goGaviaget() {
				uni.navigateTo({
					url: '../detail/detail?id=1'
				})
			},
			goRedirectTo() {
				uni.redirectTo({
					url: '../about/about'
				})
			},
			goOpenUrl() {
				// plus不支持浏览器调试，只有真机调试才有效果
				void plus.runtime.openURL('http://www.baidu.com')
			}
		}
	}
</script>

<style>
	.my-main {
		display: flex;
		width: 100%;
		justify-content: center;
	}

	.my-box {
		display: flex;
		width: 90%;
		height: 1000rpx;

		flex-direction: column;
		justify-content: space-between;
	}
</style>
